<?php
/**
 * @author Laurent SITTLER <lolo.sittler@gmail.com>
 * @author Alexandre GOMEZ <gomez.alexandre02@gmail.com>
 * @version 0.1
 */

/**
 * User Class
 */
class User {

    /**
     * Constructor
     */
    function __construct() {
        $this->m_id = -1;
        $this->m_login = NULL;
        $this->m_fname = NULL;
        $this->m_lname = NULL;
        $this->m_created = NULL;
        $this->m_log = NULL;
        $this->m_status = 0;
        $this->m_admin = 0;
    }
    
    /**
     * Create an user
     * @param Integer $id ID
     * @param String $login Login
     * @param String $fname First name
     * @param String $lname Last name
     * @param Date $created Creation date of the user
     * @param Date $log Last connexion user on interface
     * @param Integer $status Account Status
     * @param Integer $admin If user is interface admin
     */
    public function SetUser($id, $login, $fname, $lname, $created, $log, $status, $admin){
        $this->m_id = $id;
        $this->m_login = $login;
        $this->m_fname = $fname;
        $this->m_lname = $lname;
        $this->m_created = $created;
        $this->m_log = $log;
        $this->m_status = $status;
        $this->m_admin = $admin;
    }

    /**
     * Get id
     * @return Integer
     */
    public function GetId() {
        return $this->m_id;
    }
    
    /**
     * Get login
     * @return String
     */
    public function GetLogin(){
        return $this->m_login;
    }
    
    /**
     * Get last name
     * @return String
     */
    public function GetFirstName(){
        return $this->m_fname;
    }

    /**
     * Get first name
     * @return String
     */
    public function GetLastName(){
        return $this->m_lname;
    }
    
    /**
     * Get creation date
     * @return Date
     */
    public function GetCreated(){
        return $this->m_created;
    }
    
    /**
     * Get last connexion on the interface
     * @return Date
     */
    public function GetLastLog(){
        return $this->m_log;
    }

    /**
     * Get status account
     * @return Integer
     */
    public function GetStatus(){
        return $this->m_status;
    }
    
    /**
     * Get is admin (Interface)
     * @return Integer
     */
    public function GetAdmin(){
        return $this->m_admin;
    }

    /**
     * ID
     * @var Integer
     */
    private $m_id;

    /**
     * Login
     * @var String
     */
    private $m_login;
    
    /**
     * First name
     * @var String
     */
    private $m_fname;
    
    /**
     * Last name
     * @var String 
     */
    private $m_lname;
    
    /**
     * Creation date
     * @var Date 
     */
    private $m_created;
    
    /**
     * Last connexion
     * @var Date 
     */
    private $m_log;
    
    /**
     * Account status
     * @var Integer
     */
    private $m_status;
    
    /**
     * Is admin (Interface)
     * @var Integer
     */
    private $m_admin;

}